package com.Jiang.dao.Role;

import com.Jiang.dao.DateBase;
import com.Jiang.pojo.Role;
import com.Jiang.pojo.User;

import java.awt.image.RasterOp;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

public class RoleDaoImplements implements RoleDao {
    @Override
    public Vector<Role> getUserList(Connection connection) throws SQLException {
        String sql="select * from smbms_role";
        System.out.println(sql);
        ResultSet resultSet = DateBase.FindDateBase(connection, sql, new Object[]{});
        Vector<Role> users=new Vector();
        while (resultSet.next()){
            Role role=new Role();
            role.setId(resultSet.getInt("id"));
            role.setRoleCode(resultSet.getString("roleCode"));
            role.setRoleName(resultSet.getString("roleName"));
            users.add(role);
        }
        connection.close();
        return users;
    }
}
